package Honor;

import java.util.Scanner;

public class Main2 {
    public static boolean is_prim(long x){
        if (x==0||x==1){
            return false;
        }
        if (x==2){
            return true;
        }
        for (int i = 2; i <= Math.sqrt(x)+1; i++) {
            if (x%i==0){
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        long m=cin.nextInt();
        if (m%2==1){
            System.out.println(0);
            return;
        }
        long x=m/2;
        while (true){
            if (is_prim(x)&&is_prim(m-x)){
                System.out.println(x+" "+(m-x));
                return;
            }
            x--;
        }
    }
}
